# Maintainer: Alexey Pavlov <alexpux@gmail.com>

pkgname=gperf
pkgver=3.1
pkgrel=1
pkgdesc="Perfect hash function generator"
arch=('x86_64' 'i686')
url="https://www.gnu.org/software/gperf/"
license=('GPL3')
groups=('base-devel')
depends=('gcc-libs' 'info')
makedepends=('gcc' 'texinfo')
install=gperf.install
source=("https://ftp.gnu.org/pub/gnu/gperf/${pkgname}-${pkgver}.tar.gz"{,.sig}
        gperf-3.1-tests-cygwin-setmode.patch)
sha256sums=('588546b945bba4b70b6a3a616e80b4ab466e3f33024a352fc2198112cdbb3ae2'
            'SKIP'
            'b51082f190162237a106b191644968f789ba91368beac1296c8acb77ed9e4d78')
options=('!makeflags')
validpgpkeys=('93C08C88471097CD' 
'EDEB87A500CC0A211677FBFD93C08C88471097CD')

prepare() {
  cd "${srcdir}"/${pkgname}-${pkgver}
  patch -p1 -i ${srcdir}/gperf-3.1-tests-cygwin-setmode.patch
}

build() {
  cd "${srcdir}"/${pkgname}-${pkgver}
  ./configure \
    --build=${CHOST} \
    --prefix=/usr \
    --docdir=/usr/share/gperf/doc/
  make
}

check() {
  cd "${srcdir}"/${pkgname}-${pkgver}
  make check
}

package() {
  cd "${srcdir}"/${pkgname}-${pkgver}
  make DESTDIR="${pkgdir}" install
}
